/*
 * @Author: your name
 * @Date: 2021-11-17 15:33:05
 * @LastEditTime: 2022-03-24 16:14:36
 * @LastEditors: Please set LastEditors
 * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 * @FilePath: \app\src\store\modules\app.js
 */
const state = {
  /*  */
  sidebar: {
    opened: false, //菜单栏展开收起状态
  },
  tags: []
}

const mutations = {
  TOGGLE_SIDEBAR: state => {
    state.sidebar.opened = !state.sidebar.opened
  },
  CLOSE_SIDEBAR: (state) => {
    state.sidebar.opened = true
  },
  SET_TAGS: (state, data) => {
    state.tags = data
  }
}

const actions = {
  /* 展开收起边栏操作 */
  toggleSideBar({
    commit
  }) {
    commit('TOGGLE_SIDEBAR')
  },
  closeSideBar({
    commit
  }) {
    commit('CLOSE_SIDEBAR')
  },
}

export default {
  namespaced: true,
  state,
  mutations,
  actions
}